package com.zx.ymy.base

import android.app.Application
import androidx.multidex.MultiDex
import cat.ereza.customactivityoncrash.config.CaocConfig
import com.blankj.utilcode.util.Utils
import com.hd.serialport.method.DeviceMeasureController
import com.tencent.bugly.Bugly


class MyApplication : Application() {
    val instance: Application? = null
    override fun onCreate() {
        super.onCreate()
        Utils.init(this)
        MultiDex.install(this);
        CaocConfig.Builder.create()
            .backgroundMode(CaocConfig.BACKGROUND_MODE_SILENT) //default: CaocConfig.BACKGROUND_MODE_SHOW_CUSTOM
            .enabled(true) //default: true
            .showErrorDetails(true) //default: true
            .showRestartButton(true) //default: true
            .logErrorOnRestart(true) //default: true
            .trackActivities(true) //default: false
            //                .minTimeBetweenCrashesMs(2000) //default: 3000
            //                .errorActivity(CustomErrorActivity.class) //default: null (default error activity)
            //                .eventListener(new CustomEventListener()) //default: null
            .apply()
        DeviceMeasureController.init(this,true)

        Bugly.init(applicationContext, "4f75a75c32", true)


    }

}

